package com.yyc.tool.controller;

import com.yyc.tool.domain.Client;
import com.yyc.tool.service.ClientService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api("客户端管理")
@RestController
@RequestMapping("client")
public class ClientController {


    private ClientService clientService;

    @Autowired
    public void setClientService(ClientService clientService) {
        this.clientService = clientService;
    }

    @ApiOperation(value = "添加客户端信息", notes = "添加客户端信息")
    @PostMapping("add")
    public Client addClient(String name){
        return clientService.addClient(name);
    }

    @ApiOperation(value = "添加客户端信息", notes = "添加客户端信息")
    @PostMapping("addByMe")
    public Client addClientForMe(String name,String password){
        return clientService.addClientForMe(name,password);
    }
}
